xend: pass-through: Use AUTO_PHP_SLOT as unknown vslot
authorKeir Fraser <keir.fraser@citrix.com>
Thu, 4 Jun 2009 09:43:20 +0000 (10:43 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Thu, 4 Jun 2009 09:43:20 +0000 (10:43 +0100)
This fixes a few cases where 0 is still used for an known vslot.

Signed-off-by: Simon Horman <horms@verge.net.au>
tools/python/xen/xend/XendConfig.py
tools/python/xen/xend/server/pciif.py

index bc072720ee73aedfe9c6b1e5c95b16887d8be643..6ac11928f66e12c4db0d03e351706d32e83e1957 100644 (file)
@@ -31,7 +31,7 @@ from xen.xend.XendDSCSI import XendDSCSI
 from xen.xend.XendError import VmError
 from xen.xend.XendDevices import XendDevices
 from xen.xend.PrettyPrint import prettyprintstring
-from xen.xend.XendConstants import DOM_STATE_HALTED
+from xen.xend.XendConstants import DOM_STATE_HALTED, AUTO_PHP_SLOT_STR
 from xen.xend.xenstore.xstransact import xstransact
 from xen.xend.server.BlktapController import blktap_disk_types
 from xen.xend.server.netif import randomMAC
@@ -1235,7 +1235,8 @@ class XendConfig(dict):
             dpci_record = {
                 'VM': self['uuid'],
                 'PPCI': ppci_uuid,
-                'hotplug_slot': pci_dev.get('vslot', 0)
+                'hotplug_slot': pci_dev.get('vslot',
+                                            '0x' + AUTO_PHP_SLOT_STR)
             }
 
             dpci_opts = pci_dev.get('opts')
index 2f55e346fa69e6f3915ed3f6b5f6759f2eeefa21..fb182ade5c054e1f3fddda12a5850c5914a43094 100644 (file)
@@ -74,7 +74,8 @@ class PciController(DevController):
             bus = parse_hex(pci_config.get('bus', 0))
             slot = parse_hex(pci_config.get('slot', 0))
             func = parse_hex(pci_config.get('func', 0))            
-            vslot = parse_hex(pci_config.get('vslot', 0))
+            vslot = parse_hex(pci_config.get('vslot',
+                                             '0x' + AUTO_PHP_SLOT_STR))
 
             if pci_config.has_key('opts'):
                 opts = serialise_pci_opts(pci_config['opts'])